﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace arcchallenge.rot13.tests
{
    [TestFixture]
    public class test_Rot13Transformation
    {
        [Test]
        public void Output_is_sent_to_pin()
        {
            var sut = new Rot13Transformation();
            bool received_result = false;
            sut.Out_TransformedLine += l => received_result = true;

            sut.In_TransformLine("ABC");

            Assert.IsTrue(received_result);
        }


        [Test]
        public void Transform_text()
        {
            var sut = new Rot13Transformation();
            sut.Out_TransformedLine += l => Assert.AreEqual("Gur qbt onexf ng zvqavtug.", l);

            sut.In_TransformLine("The dog barks at midnight.");
        }


        [Test]
        public void Passes_on_null_string()
        {
            var sut = new Rot13Transformation();
            sut.Out_TransformedLine += Assert.IsNull;

            sut.In_TransformLine(null);
        }
    }
}
